package ru.st.selenium.applogic2;

import java.util.List;




import org.testng.Assert;

import ru.st.selenium.applogic.FilmHelper;
import ru.st.selenium.model.Film;

public class FilmHelper2 extends DriverBasedHelper implements FilmHelper {

  public FilmHelper2(ApplicationManager2 manager) {
    super(manager.getWebDriver());
  }

  @Override
  public boolean createFilm(Film film) {
   
	 pages.collectionPage.ensurePageLoaded().clickToAddMovie();
	
	if (pages.movieInformationPage
			 	.ensurePageLoaded()
			  	.fillTitle(film)
			  	.fillYear(film)
			  	.clickSubmit())
	{		
	 pages.movieInformationPage.goToTheUploadPage();
	  
	  return true;
	  
	 }
	
	return false;
}
  
 	  
	 
  @Override
  public boolean deleteMovie(Film film){
		 
		 if(pages.collectionPage
					 .deleteMovie(film))
		 return true;
				 
		 else
			 return false;
	 }


  @Override
  public List<Film> searchFilm(String title) {
    // TODO Auto-generated method stub
    return null;
  }

}
